package com.example.demo.controller;

import com.example.demo.annotation.LoggerManage;
import com.example.demo.annotation.ServiceLimit;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/demo")
public class DemoController
{
    public String hello(){
        return "hello";
    }

    @RequestMapping(value = "/say" ,method = RequestMethod.POST)
    public String say(@PathVariable String name ,@PathVariable String saying){
        return name+" saying: "+saying;
    }

    @RequestMapping("/login/{username}/{password}")
    @LoggerManage(logDescription = "login")

    public String login(@PathVariable("username") String username,@PathVariable("password") String password){
        return "login success!";
    }

}
